﻿@model IEnumerable<User>
@{string[] ranks = { "tnc-num-topone", "tnc-num-toptwo", "tnc-num-topthree", "tnc-num-topfore" };}
@if (Model != null && Model.Count() > 0)
{
    <div class="tn-box tn-widget tn-widget-content tn-corner-all spb-userfans-top">
        <div class="tn-box-header tn-widget-header tn-corner-top tn-border-bottom ">
            <h3 class="tn-helper-reset">
                粉丝人气榜</h3>
        </div>
        <div class="tn-box-content tn-widget-content tn-corner-bottom ">
            <ul class="tn-person-rank">
                @for (int i = 0; i < Model.Count(); i++)
                {
                    var user = Model.ElementAt(i);
                    <li class="tn-border-dashed tn-border-gray tn-border-bottom">
                        <div class="tnc-list-ranking">
                            @if (i < 3)
                            { 
                                <p class="tnc-blog-num @ranks[i]">
                                    <span class="tnc-charts-num">@(i + 1)</span></p>
                            }
                            else
                            { 
                                <p class="tnc-blog-num @ranks[3]">
                                    <span class="tnc-charts-num">@(i + 1)</span></p>
                            }
                        </div>
                        <div class="tnc-list-topic">
                            <div class="tn-avatar-mini">
                                @Html.ShowUserAvatar(Model.ElementAt(i), AvatarSizeType.Small, true, HyperLinkTarget._blank)
                            </div>
                            @Html.Link(StringUtility.Trim(user.DisplayName,7), SiteUrls.Instance().SpaceHome(user.UserId), user.DisplayName, new { @class = "tn-user-name" }, HyperLinkTarget._blank)
                        </div>
                        <p class="tnc-list-number">
                            @Model.ElementAt(i).FollowerCount</p>
                    </li>
                }
            </ul>
        </div>
    </div>
}